/*
 * Copyright (C) 2012 rothens
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package rpg.ui.components;

import java.awt.image.BufferedImage;
import rpg.gfx.Bitmap;
import rpg.gfx.EightPatch;
import rpg.gfx.HSVGradientColor;
import rpg.util.ImageUtil;

/**
 *
 * @author rothens
 */
public class StaticTextures {
    public static final EightPatch border_active = new EightPatch(ImageUtil.createImageIcon("/res/backgrounds/border_active.png"), 5, 5, 5, 5, 1);
    public static final EightPatch border_inactive = new EightPatch(ImageUtil.createImageIcon("/res/backgrounds/border_inactive.png"), 5, 5, 5, 5, 1);
    public static final EightPatch border_hover = new EightPatch(ImageUtil.createImageIcon("/res/backgrounds/border_hover.png"), 5, 5, 5, 5, 1);

    
    public static final HSVGradientColor red_gradient = new HSVGradientColor(HSVGradientColor.GradientType.V, 360, 100, 92, 50, false);
    public static final HSVGradientColor green_gradient = new HSVGradientColor(HSVGradientColor.GradientType.V, 100, 100, 92, 50, false);
    public static final HSVGradientColor blue_gradient = new HSVGradientColor(HSVGradientColor.GradientType.V, 230, 100, 92, 50, false);

    public static final HSVGradientColor[] button_gradients = { blue_gradient, green_gradient, red_gradient};

    public static final Bitmap[] slider;
    public static final Bitmap[] hscroll;
    public static final Bitmap[] vscroll;
    
    static {
        slider = new Bitmap[5];
        BufferedImage bi = ImageUtil.createImageIcon("/res/ui/slider.png");
        slider[0] = ImageUtil.getSub(bi, 0, 0, 32, 32);
        slider[1] = ImageUtil.getSub(bi, 32, 0, 8, 8);
        slider[2] = ImageUtil.getSub(bi, 32, 8, 8, 8);
        slider[3] = ImageUtil.getSub(bi, 32, 16, 8, 8);
        slider[4] = ImageUtil.getSub(bi, 32, 24, 8, 8);
    }
    
    static {
        BufferedImage bi = ImageUtil.createImageIcon("/res/ui/scroll.png");
        hscroll = new Bitmap[8];
        vscroll = new Bitmap[8];
        for(int i = 0; i < 8; i++){
            hscroll[i] = ImageUtil.getSub(bi, i*16, 0, 16, 16);
            vscroll[i] = ImageUtil.getSub(bi, i*16, 16, 16, 16);
        }
    }
    
    public static Bitmap testFace = ImageUtil.loadBitmap("/res/faces/test.png");
    public static Bitmap testHair = ImageUtil.loadBitmap("/res/faces/test_hair.png");
    public static Bitmap testShirt = ImageUtil.loadBitmap("/res/faces/test_shirt.png");
}